package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

import java.io.Serializable;

@Setter@Getter
public class TravelQueryObject extends QueryObject {
    private Integer state=-1;
    private Long destId=-1L;

    //前台传递过来的类型
    //排序方式
    private Integer orderType=1;
    //月份
    private Integer travelTimeType=-1;
    //开销
    private Integer perExpendType=-1;
   // 出行天数
    private Integer dayType=-1;
    //自己提供getter方法来编译
    public TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }
    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PER_EXPEND.get(perExpendType);
    }
    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }
    public String getType(){
        return orderType== 1? "t.releaseTime desc":"t.viewnum desc";
    }
}
